package com.one.blocks.rbac.controller.vo.tree;

import com.one.blocks.mvc.domain.Id;
import com.one.blocks.mvc.domain.TreeNode;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;

import java.io.Serializable;
import java.util.List;

/**
 * @author <a href="mailto:idler41@163.con">idler41</a> created on 2022-05-02 19:34:53
 */
@ApiModel(value = "系统组织")
@Data
public class SysOrgTreeNodeVo implements TreeNode<SysOrgTreeNodeVo, Integer>, Id<Integer>, Serializable {

    /**
     * 主键ID
     */
    @ApiModelProperty(value = "主键ID")
    private Integer id;

    /**
     * 上级组织id
     */
    @ApiModelProperty(value = "上级组织id")
    private Integer parentId;

    /**
     * 组织编码
     */
    @ApiModelProperty(value = "组织编码")
    private String code;

    /**
     * 组织及以下所有编码
     */
    @ApiModelProperty(value = "组织及以下所有编码")
    private String fullCode;

    /**
     * 组织名称
     */
    @ApiModelProperty(value = "组织名称")
    private String name;

    /**
     * 组织状态: 0-停用 1-启用
     */
    @ApiModelProperty(value = "组织状态: 0-停用 1-启用")
    private Integer state;

    /**
     * 显示层级
     */
    @ApiModelProperty(value = "显示层级")
    private Integer levelNum;

    /**
     * 显示顺序
     */
    @ApiModelProperty(value = "显示顺序")
    private Integer orderNum;

    @Override
    public Integer getLevel() {
        return levelNum;
    }

    @ApiModelProperty(value = "子组织")
    private List<SysOrgTreeNodeVo> children;
}